<template>
  <view class="page">
    <fu-loading v-if="isShowLoading"></fu-loading>
    <block v-else>
      <view class="text-lg text-black text-bold fu-help-title">{{ title }}</view>
    <!-- 页面加载loading  start -->

    <!-- 页面加载loading end -->
    <!-- 问题 start -->
    <jyf-parser :html="body" ></jyf-parser>
    <!-- 问题 end -->
    </block>
    <!-- 网络监测 start -->
    <fu-notwork></fu-notwork>
    <!-- 网络监测 end -->


  </view>
</template>

<script>
/**
 * @author 刘畅
 */
	import richText from '@/common/utils/richText.js';
  export default {
    data() {
      return {
        body: '',            // {String} 协议内容
        isShowLoading: true,  // {Boolean} 页面加载loading
        title: '',     // {String} 问题标题
      };
    },
    /**
     * @param {Object} options - id 问题的id
     */
    onLoad(options) {
      this.setNavigationBarTitle(this.i18n['详情'])
      this.getData(options.id)
    },

    methods: {
      /**
       * @function
       * @description 获取问题内容
       * @param {Object} id - id 问题的id
       */
      getData(id) {
        this.isShowLoading = true
        this.$api.post(global.apiUrls.postOperationGetArticleDetail, {
          // "id":id,
          "id": 1,
        }).then(res => {
          this.isShowLoading = false
          var res = res.data
          if (res.code == 1) {
            this.body = richText.format(res.data.body);
            this.title = res.data.name;
          } else {
            this.body = ''
          }
        })
      }

    }
  }
</script>

<style lang="scss" scoped>
  // 页面内容 start
  .page {
    background: #fff;
    overflow: hidden;
    height: 100vh;
    padding: 20upx;
    overflow-y: scroll;
    line-height: 48rpx;
    font-size: 32rpx;
  }

  // 页面内容 end

  // 标题
  .fu-help-title {
    line-height: 110rpx;
  }
</style>
